package com.mjl.shops.activity;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.mjl.shops.R;
import com.mjl.shops.base.BaseActivity;
import com.mjl.shops.utils.CommUtils;
import com.mjl.shops.view.IconTextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class AboutAppActivity extends BaseActivity {

    //是否有新版本
    private boolean isVer = false;

    @BindView(R.id.icon_back)
    IconTextView icon_back;

    @BindView(R.id.check_ver_tv)
    TextView check_ver_tv;

    @BindView(R.id.title_text_tv)
    TextView title_text_tv;

    @Override
    protected void setContentViewBefore() {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
    }

    @Override
    protected int getViews() {
        return R.layout.activity_about_app;
    }

    @Override
    protected void setViews() {
        ButterKnife.bind(this);
        title_text_tv.setText("关于善食");
    }

    @Override
    protected void setDate() {

    }

    @Override
    protected String getStateColor() {
        return CommUtils.color_05000000;
    }

    @Override
    protected int getStetaBackgroundStyle() {
        return 1;
    }

    @OnClick({R.id.icon_back, R.id.check_ver_tv, R.id.function_introduce_rl})
    public void OnClick(View view) {
        switch (view.getId()) {
            case R.id.icon_back:
                finish();
                break;
            case R.id.check_ver_tv:
                if (!isVer) {
                    isVer = !isVer;
                    check_ver_tv.setText("检测到新版本");
                    check_ver_tv.setTextColor(Color.parseColor("#1BBF80"));
                } else {
                    CommUtils.setToast("版本更新敬请期待！");
                }
                break;
            case R.id.function_introduce_rl:
                CommUtils.setToast("功能介绍敬请期待！");
                break;
            default:
                break;
        }
    }

    public static void StartIntent(Context contexts) {
        Intent intent = new Intent(contexts, AboutAppActivity.class);
        contexts.startActivity(intent);
    }
}
